The game is already capible of line-of-sight detection, allowing rpgSprites to "see" the player.
The first and second test maps demonstrate this, and the Rock Gang base in the Pewter dessert also uses it.
All you have to do is use the GameEditor to edit a sprite's script, and press the "Add a trigger" button, then select "see"
When the player passes in front of that character, that script will be run. Which means it could do practically anything.
A variable called "this.seeDistance" controls how many tiles a sprite can see in front of it. Each sprite has their own seeDistance variable. (That's what the word "this." does.)
My regular RPG Maker also supports the "see" trigger, so you don't necessarily have to use the pokemon game engine if your game is going to be very different.